fix(runtime): gate the seven regex-engine/test-only items so the product-scope -D warnings check compiles again - #9970
Conversation
Keep the no-default-features product build free of dead-code warnings while retaining every helper where its regex feature or unit tests need it. Dispositions: - newborn_parent_needs_barrier: cfg(test or regex-engine); feature + tests use it. - REGEXP_PROTOTYPE_PTR_SLOT: cfg(test or regex-engine); feature GC root backing. - REGEXP_PROTOTYPE_TEST_CLOSURE_SLOT: cfg(test or regex-engine); feature root backing. - REGEXP_PROTOTYPE_TEST_INDEX_SLOT: cfg(test or regex-engine); feature scalar backing. - REGEXP_PROTOTYPE_PTR: cfg(test or regex-engine); feature fast path/root scanner. - REGEXP_PROTOTYPE_TEST_CLOSURE: cfg(test or regex-engine); feature fast path/scanner. - REGEXP_PROTOTYPE_TEST_WALKS: cfg(test or regex-engine); feature/test diagnostic. Claude-Session: https://claude.ai/code/session_011dhBmdn4vGgNibjo3oZqTo
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe runtime now compiles RegExp-only garbage-collection helpers, prototype roots, test slots, and walk counters only for tests or when ChangesRegExp conditional compilation
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to RegExp-only runtime state is excluded from non-RegExp builds, fixing warnings-as-errors product checks while retaining test and regex-engine builds. No current merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Claude-Session: https://claude.ai/code/session_011dhBmdn4vGgNibjo3oZqTo (cherry picked from commit d5115df)
|
Landed on The three non-passing gates are accounted for: public-baseline is pre-existing on |
…ating #9917 collapses the three RegExp.prototype.test proof slots into one CanonicalTestSite behind a single HotKey, but was written before #9970 gated that surface for the no-default-features product build. Merged so both hold: the unified record, carrying #9970's cfg on the struct, its impl, the thread_local and TEST_ACCESSOR_KEY_BIT. Consequences reconciled: - object_static_prototype_known_non_meta is #9917's, and its only caller is regex-engine gated, so it is dead in a product build. Same gate. - The three _SLOT holder entries added for #9893 are stale: the statics no longer exist. Deleted, and a duplicate TEST_WALKS entry removed. The new REGEXP_PROTOTYPE_TEST_SITE needs no entry — the walk reaches it through scan_canonical_test_site_roots_mut, which scan_object_cache_roots_mut calls and reg_scanner! registers. - segments_view's cursor-number store carried GC_STORE_AUDIT(NUMBER), which is not an accepted class, so the marker never satisfied the gate. POINTER_FREE is the class that states what the comment argues.
Small runtime fix on
origin/main(10 lines:#[cfg]attributes + a changelog fragment). Found while replaying CI'swarningsjob locally because GitHub's runners were unavailable.Why
CI's
warningsjob runsRUSTFLAGS="-D warnings" cargo check -p perry --bins, which compilesperry-runtimewith the feature set theperrybinary requests — withoutregex-engine. Seven items are used only by theregex-enginepath and by tests, so that product-scope check fails on main with "could not compile perry-runtime (lib) due to 7 previous errors" (dead code):newborn_parent_needs_barrier(gc/barrier_store.rs) and the sixREGEXP_PROTOTYPE_*statics in object/regex_proto_thunks.rs.cargo check --workspace --all-targetsis clean because the tests keep them alive, which is why the local lint driver never saw it (see #9969). Every PR'swarningscheck has been red on main for this reason.What changes
The seven items are gated
#[cfg(any(test, feature = "regex-engine"))], matching their only users (the feature-gatedregex.rsfast path / installer / root scanner and the GC tests). Reference evidence per item is in the commit message;git log -Stracesnewborn_parent_needs_barrierto 9a2f802. No inventory changes: the root-holder statics remain live and registered inregex-enginebuilds (gc_runtime_root_holders.pyself-test OK — 90 planted / 350 entries; scan OK — 1,363 declarations, 593 scanner-reached;check_thread_locals.pyOK; rustfmt and diff-check clean).Verification
Local: the script gates above. The
-D warningsproduct check itself runs on perrymaster's local CI ladder (the Mac is out of disk for a check build); the expected result is thewarningsjob green on this head while it stays red on main.Verified locally (macOS arm64, 2026-09-08)
RUSTFLAGS="-D warnings" cargo check -p perry --bins: on main 8b7dc33 it fails with exactly the seven errors above ("could not compileperry-runtime(lib) due to 7 previous errors", exit 101); on this head it finishes clean (exit 0). The runtime lib suite on the box (Linux ladder) is the remaining check that thecfggates removed nothing the tests need.Local CI ladder on perrymaster (Linux, 2026-09-08, read against main's own baseline run):
warningsPASS — zero "never used" errors underRUSTFLAGS="-D warnings" cargo check -p perry --binsand the workspace--all-targetscheck — where main fails with the seven; perry-runtime lib suite 3,247 passed / 0 failed / 4 ignored (the gates removed nothing the tests need); every other job identical to main's (gap suite per-test sets equal on all six shards). Nothing PR-owned is red.https://claude.ai/code/session_011dhBmdn4vGgNibjo3oZqTo
Summary by CodeRabbit